package edu.towson.cosc490.incaseofemergency;

import com.bugsense.trace.BugSenseHandler;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;


public class ICoEMainScreen extends Activity {
	
	ImageButton m_MainFireLauncher;
	ImageButton m_MainFloodLauncher;
	ImageButton m_MainFluLauncher;
	ImageButton m_MainEarthquakeLauncher;
	ImageButton m_MainHurricaneLauncher;
	ImageButton m_MainSupplyKitLauncher;
	ImageButton m_WeatherNotifications;
	Activity mainScreen;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		BugSenseHandler.initAndStartSession(this, "5f7d6d2e");
		setContentView(R.layout.activity_icoe_main_screen);
		
		initLayout();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_icoe_main_screen, menu);
		return true;
	}
	
	public void initLayout(){
		mainScreen = this;
		m_MainFireLauncher =  (ImageButton)this.findViewById(R.id.buttonMainFire);
		m_MainFireLauncher.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				Intent openFireOptionsIntent = new Intent(mainScreen, FireOptions.class);
				startActivity(openFireOptionsIntent);
			}
		});
		
		m_MainFloodLauncher = (ImageButton) this.findViewById(R.id.buttonMainFlood);
		m_MainFloodLauncher.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				Intent openFloodOptionsIntent = new Intent(mainScreen, FloodOptions.class);
				startActivity(openFloodOptionsIntent);
			}
		});
		
		m_MainFluLauncher = (ImageButton) this.findViewById(R.id.buttonMainFlu);
		m_MainFluLauncher.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				Intent openFluOptionsIntent = new Intent(mainScreen, FluOptions.class);
				startActivity(openFluOptionsIntent);
			}
		});
		
		m_MainEarthquakeLauncher = (ImageButton) this.findViewById(R.id.buttonMainEarthquake);
		m_MainEarthquakeLauncher.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				Intent openEarthquakeOptionsIntent = new Intent(mainScreen, EarthquakeOptions.class);
				startActivity(openEarthquakeOptionsIntent);
			}
		});
		
		m_MainHurricaneLauncher = (ImageButton) this.findViewById(R.id.buttonMainHurricane);
		m_MainHurricaneLauncher.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				Intent openHurricaneOptionsIntent = new Intent(mainScreen, HurricaneOptions.class);
				startActivity(openHurricaneOptionsIntent);
			}
		});
		
		m_MainSupplyKitLauncher = (ImageButton) this.findViewById(R.id.buttonMainSupply);
		m_MainSupplyKitLauncher.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				Intent openSupplyKitIntent = new Intent(mainScreen, SupplyKit.class);
				startActivity(openSupplyKitIntent);
			}
		});
		
		m_WeatherNotifications = (ImageButton) this.findViewById(R.id.weather_button);
		m_WeatherNotifications.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				Intent openNotificationsIntent = new Intent(mainScreen, WeatherNotifications.class);
				startActivity(openNotificationsIntent);
			}
		});
		
	}

}
